import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;
import java.util.Map;


public class Main 
{
	
	static String msg;
	static Map<String,String> mapVars;
	
	public static void main(String[] args) throws IOException 
	{	
		mapVars = new HashMap<String,String>();
		while (true)
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
			
			msg = br.readLine();
			
			FindAnswer(msg);
		}
	}

	public static void FindAnswer(String s)
	{
		String newS[] = s.split(" ");
		
		double num1 = 0;
		double num2 = 0;
		String operator = "";
		
		try
		{
			if (!newS[1].equals("="))
			{
				if (mapVars.containsKey(newS[0]))
				{
					num1 = Double.parseDouble(mapVars.get(newS[0]));
				}
				else
				{
					num1 = Double.parseDouble(newS[0]);
				}
				if (mapVars.containsKey(newS[2]))
				{
					num2 = Double.parseDouble(mapVars.get(newS[2]));
				}
				else
				{
					num2 = Double.parseDouble(newS[2]);
				}
				
				if (mapVars.containsKey(newS[1]))
				{
					operator = mapVars.get(newS[1]);
				}
				else
				{
					operator = newS[1];
				}
			}
			
			if (operator.equals("+"))
			{
				System.out.println(num1 + num2 + "\n");
			}
			else if (operator.equals("-"))
			{
				System.out.println(num1 - num2 + "\n");
			}
			else if (operator.equals("/"))
			{
				System.out.println(num1 / num2 + "\n");
			}
			else if (operator.equals("*"))
			{
				System.out.println(num1 * num2 + "\n");
			}
			else if (newS[1].equals("="))
			{
				mapVars.put(newS[0], newS[2]);
				System.out.println(newS[0] + " assigned to " + newS[2]);
			}
		}
		catch (NumberFormatException e)
		{
			System.out.println("Inproper format");
		}
		catch (StringIndexOutOfBoundsException e)
		{
			System.out.println("Please include numbers and a + sign");
		}
		catch (ArrayIndexOutOfBoundsException e)
		{
			System.out.println("Map error; assign a variable using \"key = num\"");
		}
	}
}